// ... existing code ...
methods: {
  async refreshChannels() {
    this.loading = true
    try {
      console.log('开始刷新通道，设备ID:', this.deviceId)
      const res = await refreshChannelsByDevice(this.deviceId)
      console.log('刷新通道响应:', res)
      
      if (res && res.success) {
        console.log('通道数据:', res.data)
        this.channels = res.data || []
        this.$message.success(`通道刷新成功，获取到${this.channels.length}个通道`)
      } else {
        console.error('刷新失败:', res)
        this.$message.error(res && res.msg ? res.msg : '通道刷新失败')
      }
    } catch (e) {
      console.error('刷新异常:', e)
      this.$message.error('刷新异常: ' + (e.message || e))
    } finally {
      this.loading = false
    }
  }
}
// ... existing code ...